'use strict';
/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  // 上传
  router.post('/api/upload', controller.uploadcos.file);
  // 登录
  router.post('/api/user/login', controller.user.login);
  // 用户、角色、菜单
  router.resources('user', '/api/user', controller.user);
  router.resources('role', '/api/role', controller.role);
  router.get('/api/menu/list', controller.menu.allList);
  router.resources('menu', '/api/menu', controller.menu);

  // banner
  router.get('/api/banner/list', controller.banner.allList);
  router.resources('banner', '/api/banner', controller.banner);

  // 学校 学院 领域	专业	简称	专业介绍	学制
  router.get('/api/school/list', controller.school.allList);
  router.resources('school', '/api/school', controller.school);
  router.get('/api/college/list', controller.college.allList);
  router.resources('college', '/api/college', controller.college);
  router.get('/api/field/list', controller.field.allList);
  router.resources('field', '/api/field', controller.field);
  router.get('/api/major/list', controller.major.allList);
  router.post('/api/major/createList', controller.major.createList);
  router.resources('major', '/api/major', controller.major);

  // 课程
  router.get('/api/course/list', controller.course.allList);
  router.resources('course', '/api/course', controller.course);
};
